//
//  HJUIAlertController.h
//  KaiChat
//
//  Created by lx on 2023/10/18.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, HJUIAlertActionStyle) {
    HJUIAlertActionStyleDefault = 0,
    HJUIAlertActionStyleCancel,
    HJUIAlertActionStyleDestructive
};

typedef NS_ENUM(NSInteger, HJUIAlertControllerStyle) {
    HJUIAlertControllerStyleActionSheet = 0,
    HJUIAlertControllerStyleAlert
};

@interface HJUIAlertAction: NSObject

+ (instancetype)actionWithTitle:(nullable NSString *)title style:(HJUIAlertActionStyle)style handler:(void (^ __nullable)(HJUIAlertAction *action))handler;
@property (nonatomic, copy, readonly) NSString *title;

@end

@interface HJUIAlertController : UIViewController

@property (nonatomic, readonly) NSArray<HJUIAlertAction *> *actions;

+ (instancetype)alertControllerWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(HJUIAlertControllerStyle)preferredStyle;

- (void)showInViewController:(UIViewController *)viewController;

- (void)addAction:(HJUIAlertAction *)action;

@end

NS_ASSUME_NONNULL_END
